# -*- coding: utf-8 -*-
# @File    : items.py


from fastapi import APIRouter, Depends

from ..ext import get_db, SessionLocal
from ..models.UserModels import User

router = APIRouter(
    prefix="/items",  # url前缀
    tags=["测试"],  # 标签
    responses={404: {"description": "Not found"}},  # 错误信息
)


@router.get("/")
async def read_root(db: SessionLocal = Depends(get_db)):
    dans = db.query(User).all()
    return {"dans": dans}
